<template>
  <div class="q-pa-md q-gutter-sm">
    <t-tree
      ref="tree"
      :noConnectors="true"
      :defaultExpandAll="true"
      nodeKey="id"
      labelKey="label"
      childrenKey="children"
      :nodes="treeNode"
    >
    </t-tree>
  </div>
</template>

<script>
import { onMounted, ref } from 'vue';
export default {
  setup() {
    const tree = ref();
    let treeNode = ref([
      {
        id: 1,
        label: '一级 1',
        children: [
          {
            id: 2,
            label: '二级 1-1',
            children: [{ id: 3, label: '三级 1-1-1' }],
          },
          { id: 4, label: '二级 1-2' },
        ],
      },
    ]);

    return {
      tree,
      treeNode,
    };
  },
};
</script>
